package edu.pku.sei.mte.mtemodel.mtmodel.rulebased;

import edu.pku.sei.mte.runtime.Context;
import edu.pku.sei.mte.runtime.rulebased.RBTContext;
import edu.pku.sei.mte.utilities.Visitable;
import edu.pku.sei.mte.utilities.Visitor;

abstract public class Rule implements Visitable{

	private String name;
	private RBTransformation host;
	private int priority;//0 - first

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public RBTransformation getHost() {
		return host;
	}

	public void setHost(RBTransformation host) {
		this.host = host;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}
	abstract public void registVariableToContext(Context context);
	abstract public void registVariableToContext(RBTContext context);
	@Override
	public Object accept(Visitor visitor) throws Exception {
		return visitor.visitRule(this);
	}
}
